.class public Lcom/netease/newsreader/activity/SelectCity;
.super Lcom/netease/newsreader/activity/BaseActivity;
.source "SelectCity.java"


# static fields
.field private static final LETTER:[Ljava/lang/String; = null

.field private static final MSG_CITY_SEARCH:I = 0x3

.field private static final MSG_IP_QUERY:I = 0x2

.field private static final MSG_LOADING_ALL:I = 0x0

.field private static final MSG_LOADING_GROUP:I = 0x1


# instance fields
.field private mCityAdapter:Lcom/netease/newsreader/adapter/CityGroupAdapter;

.field private mCityGroupList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/netease/newsreader/util/Pair",
            "<",
            "Ljava/lang/String;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;>;>;"
        }
    .end annotation
.end field

.field private mCityList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;"
        }
    .end annotation
.end field

.field private mCitySearchAdapter:Lcom/netease/newsreader/adapter/CitySearchAdapter;

.field private mCurrCity:Ljava/lang/String;

.field private mCurrProvince:Ljava/lang/String;

.field private mFilter:Landroid/widget/Filter;

.field private mHandler:Landroid/os/Handler;

.field private mImm:Landroid/view/inputmethod/InputMethodManager;

.field private mIndicator:Landroid/widget/LinearLayout;

.field private mIndicatorPopup:Landroid/widget/PopupWindow;

.field private mIndicatorPosition:I

.field private mIndicatorText:Landroid/widget/TextView;

.field private mListView:Landroid/widget/ListView;

.field private mLoadingView:Landroid/view/View;

.field private mSearchEditText:Landroid/widget/EditText;

.field private mSearchListView:Landroid/widget/ListView;

.field private mTitleView:Landroid/widget/TextView;

.field private sp:Landroid/content/SharedPreferences;


# direct methods
.method static constructor <clinit>()V
    .locals 4

    .prologue
    const/16 v3, 0x1a

    .line 58
    new-array v1, v3, [Ljava/lang/String;

    sput-object v1, Lcom/netease/newsreader/activity/SelectCity;->LETTER:[Ljava/lang/String;

    .line 61
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-lt v0, v3, :cond_0

    .line 48
    return-void

    .line 62
    :cond_0
    sget-object v1, Lcom/netease/newsreader/activity/SelectCity;->LETTER:[Ljava/lang/String;

    add-int/lit8 v2, v0, 0x41

    int-to-char v2, v2

    invoke-static {v2}, Ljava/lang/Character;->toString(C)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v0

    .line 61
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    .line 48
    invoke-direct {p0}, Lcom/netease/newsreader/activity/BaseActivity;-><init>()V

    .line 66
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityGroupList:Ljava/util/List;

    .line 68
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityList:Ljava/util/List;

    .line 90
    const/4 v0, -0x1

    iput v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPosition:I

    .line 450
    new-instance v0, Lcom/netease/newsreader/activity/SelectCity$1;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/activity/SelectCity$1;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mHandler:Landroid/os/Handler;

    .line 501
    new-instance v0, Lcom/netease/newsreader/activity/SelectCity$2;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/activity/SelectCity$2;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mFilter:Landroid/widget/Filter;

    .line 48
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/activity/SelectCity;)Ljava/util/List;
    .locals 1
    .parameter

    .prologue
    .line 68
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityList:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$1(Lcom/netease/newsreader/activity/SelectCity;)Ljava/util/List;
    .locals 1
    .parameter

    .prologue
    .line 66
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityGroupList:Ljava/util/List;

    return-object v0
.end method

.method static synthetic access$10(Lcom/netease/newsreader/activity/SelectCity;)Landroid/widget/ListView;
    .locals 1
    .parameter

    .prologue
    .line 78
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchListView:Landroid/widget/ListView;

    return-object v0
.end method

.method static synthetic access$11(Lcom/netease/newsreader/activity/SelectCity;Ljava/lang/String;Ljava/lang/String;I)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 359
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/newsreader/activity/SelectCity;->selectCity(Ljava/lang/String;Ljava/lang/String;I)V

    return-void
.end method

.method static synthetic access$12(Lcom/netease/newsreader/activity/SelectCity;)Landroid/view/inputmethod/InputMethodManager;
    .locals 1
    .parameter

    .prologue
    .line 98
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mImm:Landroid/view/inputmethod/InputMethodManager;

    return-object v0
.end method

.method static synthetic access$13(Lcom/netease/newsreader/activity/SelectCity;)Landroid/widget/EditText;
    .locals 1
    .parameter

    .prologue
    .line 80
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchEditText:Landroid/widget/EditText;

    return-object v0
.end method

.method static synthetic access$14(Lcom/netease/newsreader/activity/SelectCity;)V
    .locals 0
    .parameter

    .prologue
    .line 333
    invoke-direct {p0}, Lcom/netease/newsreader/activity/SelectCity;->updateIpCity()V

    return-void
.end method

.method static synthetic access$15(Lcom/netease/newsreader/activity/SelectCity;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 90
    iput p1, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPosition:I

    return-void
.end method

.method static synthetic access$16(Lcom/netease/newsreader/activity/SelectCity;)I
    .locals 1
    .parameter

    .prologue
    .line 90
    iget v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPosition:I

    return v0
.end method

.method static synthetic access$17(Lcom/netease/newsreader/activity/SelectCity;)Landroid/widget/PopupWindow;
    .locals 1
    .parameter

    .prologue
    .line 100
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    return-object v0
.end method

.method static synthetic access$18(Lcom/netease/newsreader/activity/SelectCity;)Landroid/widget/TextView;
    .locals 1
    .parameter

    .prologue
    .line 88
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorText:Landroid/widget/TextView;

    return-object v0
.end method

.method static synthetic access$2(Lcom/netease/newsreader/activity/SelectCity;)Lcom/netease/newsreader/adapter/CityGroupAdapter;
    .locals 1
    .parameter

    .prologue
    .line 70
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityAdapter:Lcom/netease/newsreader/adapter/CityGroupAdapter;

    return-object v0
.end method

.method static synthetic access$3(Lcom/netease/newsreader/activity/SelectCity;)Landroid/view/View;
    .locals 1
    .parameter

    .prologue
    .line 82
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mLoadingView:Landroid/view/View;

    return-object v0
.end method

.method static synthetic access$4(Lcom/netease/newsreader/activity/SelectCity;)Lcom/netease/newsreader/adapter/CitySearchAdapter;
    .locals 1
    .parameter

    .prologue
    .line 72
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mCitySearchAdapter:Lcom/netease/newsreader/adapter/CitySearchAdapter;

    return-object v0
.end method

.method static synthetic access$5(Lcom/netease/newsreader/activity/SelectCity;)Landroid/os/Handler;
    .locals 1
    .parameter

    .prologue
    .line 450
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mHandler:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic access$6(Lcom/netease/newsreader/activity/SelectCity;Ljava/lang/String;)Ljava/util/List;
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 520
    invoke-direct {p0, p1}, Lcom/netease/newsreader/activity/SelectCity;->getFilteredResults(Ljava/lang/String;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$7()[Ljava/lang/String;
    .locals 1

    .prologue
    .line 58
    sget-object v0, Lcom/netease/newsreader/activity/SelectCity;->LETTER:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$8(Lcom/netease/newsreader/activity/SelectCity;)Landroid/widget/ListView;
    .locals 1
    .parameter

    .prologue
    .line 74
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mListView:Landroid/widget/ListView;

    return-object v0
.end method

.method static synthetic access$9(Lcom/netease/newsreader/activity/SelectCity;)Landroid/widget/LinearLayout;
    .locals 1
    .parameter

    .prologue
    .line 86
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicator:Landroid/widget/LinearLayout;

    return-object v0
.end method

.method private addIndicatorItem(Ljava/lang/String;)V
    .locals 3
    .parameter "str"

    .prologue
    const/4 v2, -0x1

    .line 441
    new-instance v1, Landroid/widget/TextView;

    invoke-direct {v1, p0}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    .line 442
    .local v1, textView:Landroid/widget/TextView;
    new-instance v0, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v0, v2, v2}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    .line 444
    .local v0, lp:Landroid/widget/LinearLayout$LayoutParams;
    const/high16 v2, 0x3f80

    iput v2, v0, Landroid/widget/LinearLayout$LayoutParams;->weight:F

    .line 445
    const v2, 0x7f0a000f

    invoke-virtual {v1, p0, v2}, Landroid/widget/TextView;->setTextAppearance(Landroid/content/Context;I)V

    .line 446
    invoke-virtual {v1, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 447
    iget-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicator:Landroid/widget/LinearLayout;

    invoke-virtual {v2, v1, v0}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 448
    return-void
.end method

.method private findViewsById()V
    .locals 3

    .prologue
    .line 199
    const v0, 0x7f0c0008

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mTitleView:Landroid/widget/TextView;

    .line 200
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mTitleView:Landroid/widget/TextView;

    new-instance v1, Ljava/lang/StringBuilder;

    const v2, 0x7f0b00a0

    invoke-virtual {p0, v2}, Lcom/netease/newsreader/activity/SelectCity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCurrCity:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 201
    const v0, 0x7f0c0007

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    new-instance v1, Lcom/netease/newsreader/activity/SelectCity$4;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/activity/SelectCity$4;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 210
    const v0, 0x7f0c012f

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchEditText:Landroid/widget/EditText;

    .line 211
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchEditText:Landroid/widget/EditText;

    new-instance v1, Lcom/netease/newsreader/activity/SelectCity$5;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/activity/SelectCity$5;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V

    .line 244
    const v0, 0x7f0c0130

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchListView:Landroid/widget/ListView;

    .line 245
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchListView:Landroid/widget/ListView;

    iget-object v1, p0, Lcom/netease/newsreader/activity/SelectCity;->mCitySearchAdapter:Lcom/netease/newsreader/adapter/CitySearchAdapter;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 246
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchListView:Landroid/widget/ListView;

    new-instance v1, Lcom/netease/newsreader/activity/SelectCity$6;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/activity/SelectCity$6;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 255
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchListView:Landroid/widget/ListView;

    new-instance v1, Lcom/netease/newsreader/activity/SelectCity$7;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/activity/SelectCity$7;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 289
    const v0, 0x7f0c00cc

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mListView:Landroid/widget/ListView;

    .line 291
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mListView:Landroid/widget/ListView;

    iget-object v1, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityAdapter:Lcom/netease/newsreader/adapter/CityGroupAdapter;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 292
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mListView:Landroid/widget/ListView;

    new-instance v1, Lcom/netease/newsreader/activity/SelectCity$8;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/activity/SelectCity$8;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 316
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mListView:Landroid/widget/ListView;

    new-instance v1, Lcom/netease/newsreader/activity/SelectCity$9;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/activity/SelectCity$9;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 327
    const v0, 0x7f0c0132

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mLoadingView:Landroid/view/View;

    .line 329
    const v0, 0x7f0c0131

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicator:Landroid/widget/LinearLayout;

    .line 330
    invoke-direct {p0}, Lcom/netease/newsreader/activity/SelectCity;->initIndicator()V

    .line 331
    return-void
.end method

.method private getFilteredResults(Ljava/lang/String;)Ljava/util/List;
    .locals 5
    .parameter "constraint"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;"
        }
    .end annotation

    .prologue
    .line 521
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 522
    .local v2, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    iget-object v4, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityList:Ljava/util/List;

    invoke-interface {v4}, Ljava/util/List;->size()I

    move-result v0

    .line 523
    .local v0, N:I
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-lt v1, v0, :cond_0

    .line 529
    return-object v2

    .line 524
    :cond_0
    iget-object v4, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityList:Ljava/util/List;

    invoke-interface {v4, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/Map;

    .line 525
    .local v3, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v4, "city"

    invoke-interface {v3, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    invoke-virtual {v4, p1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_1

    .line 526
    invoke-interface {v2, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 523
    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method private initIndicator()V
    .locals 7

    .prologue
    const/4 v6, -0x2

    .line 372
    const-string v3, "#"

    invoke-direct {p0, v3}, Lcom/netease/newsreader/activity/SelectCity;->addIndicatorItem(Ljava/lang/String;)V

    .line 373
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    sget-object v3, Lcom/netease/newsreader/activity/SelectCity;->LETTER:[Ljava/lang/String;

    array-length v3, v3

    if-lt v0, v3, :cond_0

    .line 377
    invoke-static {p0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v3

    const v4, 0x7f03002d

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    .line 378
    .local v1, popupContent:Landroid/view/View;
    const v3, 0x7f0c00c0

    invoke-virtual {v1, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/TextView;

    iput-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorText:Landroid/widget/TextView;

    .line 380
    new-instance v3, Landroid/widget/PopupWindow;

    .line 381
    const/4 v4, 0x0

    invoke-direct {v3, v1, v6, v6, v4}, Landroid/widget/PopupWindow;-><init>(Landroid/view/View;IIZ)V

    .line 380
    iput-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    .line 382
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/SelectCity;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v3

    iget v3, v3, Landroid/util/DisplayMetrics;->density:F

    const/high16 v4, 0x42a0

    mul-float/2addr v3, v4

    float-to-int v2, v3

    .line 383
    .local v2, size:I
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    invoke-virtual {v3, v2}, Landroid/widget/PopupWindow;->setWidth(I)V

    .line 384
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    invoke-virtual {v3, v2}, Landroid/widget/PopupWindow;->setHeight(I)V

    .line 385
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    const v4, 0x7f0a002a

    invoke-virtual {v3, v4}, Landroid/widget/PopupWindow;->setAnimationStyle(I)V

    .line 386
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicator:Landroid/widget/LinearLayout;

    new-instance v4, Lcom/netease/newsreader/activity/SelectCity$11;

    invoke-direct {v4, p0}, Lcom/netease/newsreader/activity/SelectCity$11;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-virtual {v3, v4}, Landroid/widget/LinearLayout;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 438
    return-void

    .line 374
    .end local v1           #popupContent:Landroid/view/View;
    .end local v2           #size:I
    :cond_0
    sget-object v3, Lcom/netease/newsreader/activity/SelectCity;->LETTER:[Ljava/lang/String;

    aget-object v3, v3, v0

    invoke-direct {p0, v3}, Lcom/netease/newsreader/activity/SelectCity;->addIndicatorItem(Ljava/lang/String;)V

    .line 373
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method private selectCity(Ljava/lang/String;Ljava/lang/String;I)V
    .locals 3
    .parameter "newProvince"
    .parameter "newCity"
    .parameter "count"

    .prologue
    .line 360
    const/4 v0, 0x0

    .line 361
    .local v0, result:I
    iget-object v1, p0, Lcom/netease/newsreader/activity/SelectCity;->mCurrCity:Ljava/lang/String;

    invoke-virtual {v1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/netease/newsreader/activity/SelectCity;->mCurrProvince:Ljava/lang/String;

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 362
    :cond_0
    invoke-static {p0, p1, p2}, Lcom/netease/newsreader/model/City;->saveCity(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 363
    iget-object v1, p0, Lcom/netease/newsreader/activity/SelectCity;->db:Landroid/database/sqlite/SQLiteDatabase;

    add-int/lit8 v2, p3, 0x1

    invoke-static {v1, p1, p2, v2}, Lcom/netease/newsreader/model/City;->updateSelectCount(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;Ljava/lang/String;I)V

    .line 364
    const/4 v0, -0x1

    .line 367
    :cond_1
    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectCity;->setResult(I)V

    .line 368
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/SelectCity;->finish()V

    .line 369
    return-void
.end method

.method private updateIpCity()V
    .locals 4

    .prologue
    .line 334
    iget-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityGroupList:Ljava/util/List;

    const/4 v3, 0x0

    invoke-interface {v2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/netease/newsreader/util/Pair;

    .line 335
    .local v1, pair:Lcom/netease/newsreader/util/Pair;,"Lcom/netease/newsreader/util/Pair<Ljava/lang/String;Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;>;"
    iget-object v2, v1, Lcom/netease/newsreader/util/Pair;->second:Ljava/lang/Object;

    check-cast v2, Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->clear()V

    .line 336
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    .line 337
    .local v0, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v2, "ipquery"

    const/4 v3, 0x1

    invoke-static {v3}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 338
    iget-object v2, v1, Lcom/netease/newsreader/util/Pair;->second:Ljava/lang/Object;

    check-cast v2, Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 339
    iget-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityAdapter:Lcom/netease/newsreader/adapter/CityGroupAdapter;

    invoke-virtual {v2}, Lcom/netease/newsreader/adapter/CityGroupAdapter;->notifyDataSetChanged()V

    .line 340
    new-instance v2, Ljava/lang/Thread;

    new-instance v3, Lcom/netease/newsreader/activity/SelectCity$10;

    invoke-direct {v3, p0}, Lcom/netease/newsreader/activity/SelectCity$10;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-direct {v2, v3}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 356
    invoke-virtual {v2}, Ljava/lang/Thread;->start()V

    .line 357
    return-void
.end method


# virtual methods
.method public goBackClick(Landroid/view/View;)V
    .locals 0
    .parameter "view"

    .prologue
    .line 195
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/SelectCity;->finish()V

    .line 196
    return-void
.end method

.method public onApplyTheme()V
    .locals 7

    .prologue
    const v6, 0x7f080027

    const v5, 0x7f020070

    .line 534
    invoke-super {p0}, Lcom/netease/newsreader/activity/BaseActivity;->onApplyTheme()V

    .line 535
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/SelectCity;->getThemeSettingsHelper()Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v2

    .line 536
    .local v2, themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mTitleView:Landroid/widget/TextView;

    const v4, 0x7f080025

    invoke-virtual {v2, p0, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    .line 537
    const v3, 0x7f0c006f

    const v4, 0x7f020089

    invoke-virtual {v2, p0, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setImageViewSrc(Landroid/app/Activity;II)V

    .line 538
    const v3, 0x7f0c0007

    const v4, 0x7f0200fe

    invoke-virtual {v2, p0, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroud(Landroid/app/Activity;II)V

    .line 539
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mListView:Landroid/widget/ListView;

    invoke-virtual {v2, p0, v3, v5}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setListViewDivider(Landroid/content/Context;Landroid/widget/ListView;I)V

    .line 540
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchListView:Landroid/widget/ListView;

    invoke-virtual {v2, p0, v3, v5}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setListViewDivider(Landroid/content/Context;Landroid/widget/ListView;I)V

    .line 541
    const v3, 0x7f0c012c

    .line 542
    const v4, 0x7f080029

    .line 541
    invoke-virtual {v2, p0, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroudColor(Landroid/app/Activity;II)V

    .line 544
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicator:Landroid/widget/LinearLayout;

    invoke-virtual {v3}, Landroid/widget/LinearLayout;->getChildCount()I

    move-result v0

    .line 545
    .local v0, N:I
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-lt v1, v0, :cond_2

    .line 550
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityAdapter:Lcom/netease/newsreader/adapter/CityGroupAdapter;

    if-eqz v3, :cond_0

    .line 551
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityAdapter:Lcom/netease/newsreader/adapter/CityGroupAdapter;

    invoke-virtual {v3}, Lcom/netease/newsreader/adapter/CityGroupAdapter;->notifyDataSetChanged()V

    .line 554
    :cond_0
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mCitySearchAdapter:Lcom/netease/newsreader/adapter/CitySearchAdapter;

    if-eqz v3, :cond_1

    .line 555
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mCitySearchAdapter:Lcom/netease/newsreader/adapter/CitySearchAdapter;

    invoke-virtual {v3}, Lcom/netease/newsreader/adapter/CitySearchAdapter;->notifyDataSetChanged()V

    .line 561
    :cond_1
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorText:Landroid/widget/TextView;

    invoke-virtual {v2, p0, v3, v6}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    .line 574
    const v3, 0x7f0c0002

    const v4, 0x7f020041

    invoke-virtual {v2, p0, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setImageViewSrc(Landroid/app/Activity;II)V

    .line 575
    return-void

    .line 546
    :cond_2
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicator:Landroid/widget/LinearLayout;

    invoke-virtual {v3, v1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/TextView;

    invoke-virtual {v2, p0, v3, v6}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    .line 545
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 5
    .parameter "savedInstanceState"

    .prologue
    const/4 v3, 0x1

    const/4 v4, 0x0

    .line 104
    invoke-super {p0, p1}, Lcom/netease/newsreader/activity/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    .line 105
    invoke-virtual {p0, v3}, Lcom/netease/newsreader/activity/SelectCity;->requestWindowFeature(I)Z

    .line 106
    const v2, 0x7f030055

    invoke-virtual {p0, v2}, Lcom/netease/newsreader/activity/SelectCity;->setContentView(I)V

    .line 108
    const-string v2, "input_method"

    invoke-virtual {p0, v2}, Lcom/netease/newsreader/activity/SelectCity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputMethodManager;

    iput-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mImm:Landroid/view/inputmethod/InputMethodManager;

    .line 110
    invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v2

    iput-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->sp:Landroid/content/SharedPreferences;

    .line 111
    invoke-static {p0, v4}, Lcom/netease/newsreader/model/City;->getCurrentCity(Landroid/content/Context;Z)[Ljava/lang/String;

    move-result-object v1

    .line 112
    .local v1, ss:[Ljava/lang/String;
    aget-object v2, v1, v4

    iput-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCurrProvince:Ljava/lang/String;

    .line 113
    aget-object v2, v1, v3

    iput-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCurrCity:Ljava/lang/String;

    .line 115
    new-instance v2, Lcom/netease/newsreader/adapter/CitySearchAdapter;

    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mFilter:Landroid/widget/Filter;

    invoke-direct {v2, p0, v3}, Lcom/netease/newsreader/adapter/CitySearchAdapter;-><init>(Landroid/content/Context;Landroid/widget/Filter;)V

    iput-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCitySearchAdapter:Lcom/netease/newsreader/adapter/CitySearchAdapter;

    .line 117
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 118
    .local v0, ipqueryList:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    iget-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityGroupList:Ljava/util/List;

    const v3, 0x7f0b00a4

    invoke-virtual {p0, v3}, Lcom/netease/newsreader/activity/SelectCity;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3, v0}, Lcom/netease/newsreader/util/Pair;->create(Ljava/lang/Object;Ljava/lang/Object;)Lcom/netease/newsreader/util/Pair;

    move-result-object v3

    invoke-interface {v2, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 119
    new-instance v2, Lcom/netease/newsreader/adapter/CityGroupAdapter;

    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityGroupList:Ljava/util/List;

    invoke-direct {v2, p0, v3}, Lcom/netease/newsreader/adapter/CityGroupAdapter;-><init>(Landroid/content/Context;Ljava/util/List;)V

    iput-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mCityAdapter:Lcom/netease/newsreader/adapter/CityGroupAdapter;

    .line 121
    invoke-direct {p0}, Lcom/netease/newsreader/activity/SelectCity;->findViewsById()V

    .line 123
    iget-object v2, p0, Lcom/netease/newsreader/activity/SelectCity;->mLoadingView:Landroid/view/View;

    invoke-virtual {v2, v4}, Landroid/view/View;->setVisibility(I)V

    .line 124
    new-instance v2, Ljava/lang/Thread;

    new-instance v3, Lcom/netease/newsreader/activity/SelectCity$3;

    invoke-direct {v3, p0}, Lcom/netease/newsreader/activity/SelectCity$3;-><init>(Lcom/netease/newsreader/activity/SelectCity;)V

    invoke-direct {v2, v3}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 164
    invoke-virtual {v2}, Ljava/lang/Thread;->start()V

    .line 165
    invoke-direct {p0}, Lcom/netease/newsreader/activity/SelectCity;->updateIpCity()V

    .line 167
    const-string v2, "CHANGE_CITY"

    const-string v3, "changecity"

    invoke-static {p0, v2, v3}, Lcom/netease/mobileanalysis/MobileAgent;->setEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 168
    return-void
.end method

.method protected onDestroy()V
    .locals 1

    .prologue
    .line 174
    invoke-super {p0}, Lcom/netease/newsreader/activity/BaseActivity;->onDestroy()V

    .line 175
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    invoke-virtual {v0}, Landroid/widget/PopupWindow;->isShowing()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 176
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mIndicatorPopup:Landroid/widget/PopupWindow;

    invoke-virtual {v0}, Landroid/widget/PopupWindow;->dismiss()V

    .line 178
    :cond_0
    return-void
.end method

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 2
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 184
    const/4 v0, 0x4

    if-ne p1, v0, :cond_0

    .line 185
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchListView:Landroid/widget/ListView;

    invoke-virtual {v0}, Landroid/widget/ListView;->getVisibility()I

    move-result v0

    if-nez v0, :cond_0

    .line 186
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectCity;->mSearchEditText:Landroid/widget/EditText;

    const-string v1, ""

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 187
    const/4 v0, 0x1

    .line 191
    :goto_0
    return v0

    :cond_0
    invoke-super {p0, p1, p2}, Lcom/netease/newsreader/activity/BaseActivity;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v0

    goto :goto_0
.end method
